<template>
	<view>

		<view class="cu-bar bg-white solid-bottom margin-top">
			<view class="action">
				<text class=" cuIcon-title text-red  text-bold "></text> 我的排名
			</view>
		</view>
		<view class="cu-list menu-avatar">

			<view class="cu-item">
				<view class=" cu-avatar round lg" :style="'background-image:url(' + rankingList.myRank.avatar + ')'">
					<view class="cu-tag bg-yellow badge">{{ rankingList.myRank.rank }}</view>

				</view>
				<view class="content">
					<view>
						<view class="text-cut">{{ rankingList.myRank.nickname }}</view>
					</view>
					<view class="text-gray text-sm flex">
						<!-- <view class="text-cut"> 等我回来一个打十个</view> -->
					</view>
				</view>
				<view class="action">
					<view class="text-blue text-xs">积分</view>
					<view class="cu-tag round bg-blue     sm">{{ rankingList.myRank.score }}</view>
				</view>

			</view>

		</view>



		<!-- 今日排名 -->
		<view class="cu-bar bg-white solid-bottom margin-top">
			<view class="action">
				<text class=" cuIcon-title text-red  text-bold "></text> 全部排名
			</view>
		</view>
		<view class="cu-list menu-avatar">

			<view class="cu-item" v-for="(item, index) in rankingList.allRankList" :key="index">
				<view class=" cu-avatar round lg" :style="'background-image:url(' + item.avatar + ')'">
					<view v-if="index == 0" class="cu-tag bg-yellow badge">1</view>
					<view v-if="index == 1" style="color: #333;" class="cu-tag bg-gray badge">2</view>
					<view v-if="index == 2" class="cu-tag bg-brown badge">3</view>
				</view>
				<view class="content">
					<view>
						<view class="text-cut">{{ item.nickname }}</view>
					</view>
					<view class="text-gray text-sm flex">
						<!-- <view class="text-cut"> 等我回来一个打十个</view> -->
					</view>
				</view>
				<view class="action">
					<view class="text-blue text-xs">积分</view>
					<view class="cu-tag round bg-blue     sm">{{ item.score }}</view>
				</view>

			</view>

		</view>


	</view>
</template>

<script>
export default {
	data() {
		return {
			rankingList: {},//排名列表
		}
	},
	onLoad(options) {
		this.getRankingList()
	},
	methods: {
		getRankingList() {
			console.log('123')
			this.$myHttp.get({
				url: this.$myHttp.urlMap.rankList,
				data: {
					limit: 1000,
					page: 1
				},
				needLogin: true,

				success: res => {
					this.rankingList = res.data.data
					console.log('%c [ this.rankingList ]-251', 'font-size:13px; background:pink; color:#bf2c9f;', this.rankingList)
				}
			})
		}
	}
}
</script>

<style>
.cu-divider1 {
	text-align: center;
	margin-top: 10px;
	padding: 10px 0px 0px 0px;
	width: 100%;
	height: 10px;
	border-top: 1px dashed #acacac;
}

.cu-divider {
	text-align: center;
	margin-top: 20px;
	padding: 10px 0 10px 0;
	width: 100%;
	height: 30px;
	border-top: 1px dashed #acacac;
}
</style>
